//
//  EditCell.m
//  云律司
//
//  Created by 韦淋 on 2017/7/5.
//  Copyright © 2017年 test. All rights reserved.
//

#import "EditCell.h"

@implementation EditCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initalizeInterface];
    }
    return self;
}

- (void)initalizeInterface{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.titleImage];
    [self.bgView addSubview:self.titleLable];
    [self.contentView addSubview:self.inputInfo];
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
    view.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
    [self.bgView insertSubview:view belowSubview:self.titleImage];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.titleImage.frame = CGRectMake(10, 10, 20, 20);
    self.titleLable.frame = CGRectMake(40, 0, 90, 40);
    self.bgView.frame = CGRectMake(10, 10, self.contentView.bounds.size.width - 20, 40);
    self.inputInfo.frame = CGRectMake(150, 10, 200, 40);
}

- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor whiteColor];
        _bgView.layer.borderWidth = 1.0f;
        _bgView.layer.borderColor = [[UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f] CGColor];
    }
    return _bgView;
}
- (UIImageView *)titleImage{
    if (!_titleImage) {
        _titleImage = [[UIImageView alloc] init];
        //        _titleImage.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
    }
    return _titleImage;
}
- (UILabel *)titleLable{
    if (!_titleLable) {
        _titleLable = [[UILabel alloc]init];
        _titleLable.textColor = [UIColor blackColor];
        _titleLable.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        _titleLable.textColor = [UIColor blackColor];
        _titleLable.font = [UIFont systemFontOfSize:13];
    }
    return _titleLable;
}
- (UITextField *)inputInfo{
    if (!_inputInfo) {
        _inputInfo = [[UITextField alloc] init];
        _inputInfo.clearButtonMode = UITextFieldViewModeWhileEditing;
        
        
        _inputInfo.textAlignment = NSTextAlignmentLeft;
        _inputInfo.font = [UIFont systemFontOfSize:13];
    }
    return _inputInfo;
}

@end
